package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.blankj.utilcode.util.NetworkUtils;

import flc.ast.R;
import flc.ast.databinding.FragmentNetworkTabBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.device.NetUtil;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link NetworkTabFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class NetworkTabFragment extends BaseNoModelFragment<FragmentNetworkTabBinding> {

    @Override
    protected int onCreate() {
        return R.layout.fragment_network_tab;
    }

    @Override
    protected void initView() {
        mDataBinding.tvWifi.setText(NetUtil.isWIFIConnected(mContext) ? getString(R.string.ylj_text) : getString(R.string.wlj_text));
        mDataBinding.tvIp.setText(NetUtil.getIpAddressString());
        mDataBinding.tvYiDong.setText(NetUtil.isMobileConnected(mContext) ? getString(R.string.ylj_text) : getString(R.string.wlj_text));
        mDataBinding.tvSim.setText(NetUtil.isMobileConnected(mContext) ? getString(R.string.online_text) : getString(R.string.not_service_text));
        mDataBinding.tvSsid.setText(NetworkUtils.getSSID());
        mDataBinding.tvYidongName.setText(TextUtils.isEmpty(NetworkUtils.getNetworkOperatorName()) ? getString(R.string.unknown_text) : NetworkUtils.getNetworkOperatorName());
    }

    @Override
    protected void initData() {

    }
}